package com.glink.manage.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.glink.common.exception.GeneralSimpleException;
import com.glink.common.util.BaseCommonUtils;
import com.glink.common.util.LogUtil;
import com.glink.common.vo.ResponseResult;
import com.glink.manage.common.PoiTools;
import com.glink.manage.dto.constructionwork.ConstructionWorkSiteIdOrEquipObjIdDTO;
import com.glink.manage.dto.equip.PatrolIntelligentEquipBroadcastStatusDTO;
import com.glink.manage.dto.equip.PatrolIntelligentEquipDTO;
import com.glink.manage.dto.equip.PatrolIntelligentEquipPageDTO;
import com.glink.manage.dto.video.*;
import com.glink.manage.service.PatrolIntelligentEquipCarouselService;
import com.glink.manage.service.PatrolIntelligentEquipService;
import com.glink.manage.sip.EquipSipService;
import com.glink.manage.vo.constructionwork.ConstructionWorkAndWorkSiteInfoVO;
import com.glink.manage.vo.equip.PatrolIntelligentEquipNvrVO;
import com.glink.manage.vo.equip.PatrolIntelligentEquipVO;
import com.glink.manage.vo.sip.SipServerInfoVo;
import com.glink.manage.vo.video.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author  glink
 * @since  2024-07-01
 */
@Slf4j
@RestController
@RequestMapping("/API/Manage/patrolIntelligentEquip")
@Api(tags = "装置管理")
public class PatrolIntelligentEquipController extends AbstractBaseController {

    @Autowired
    private PatrolIntelligentEquipService intelligentEquipService;

    @Autowired
    private EquipSipService equipSipService;

    @Autowired
    private PatrolIntelligentEquipCarouselService intelligentEquipCarouselService;

    @ApiOperation(value = "1.新增设备")
    @PostMapping(value = "/insertIntelligentEquip", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Boolean> insertIntelligentEquip(@Validated @RequestBody PatrolIntelligentEquipDTO dto, HttpServletRequest request) throws Exception {
        log.info("1.新增设备：{}", LogUtil.encode(dto));
        String remoteIp = BaseCommonUtils.getIP(request);
        boolean insertStatus = intelligentEquipService.insertIntelligentEquip(dto, remoteIp);
        return this.response(insertStatus);
    }

    @ApiOperation(value = "2.更新设备")
    @PostMapping(value = "/updateIntelligentEquip", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Boolean> updateIntelligentEquip(@Validated @RequestBody PatrolIntelligentEquipDTO dto, HttpServletRequest request) throws Exception {
        log.info("2.更新设备：{}", LogUtil.encode(dto));
        String remoteIp = BaseCommonUtils.getIP(request);
        boolean insertStatus = intelligentEquipService.updateIntelligentEquip(dto, remoteIp);
        return this.response(insertStatus);
    }

    @ApiOperation(value = "3.分页查询设备")
    @PostMapping(value = "/findPageEquip", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<IPage<PatrolIntelligentEquipVO>> findPage(@Validated @RequestBody PatrolIntelligentEquipPageDTO dto)throws GeneralSimpleException {
        log.info("3.分页查询设备：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findPageEquip(dto));
    }

    //todo 根据原型 应该是查询的应该是
    @ApiOperation(value = "3-1.分页查询硬盘录像机")
    @PostMapping(value = "/findPageNvr", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<IPage<PatrolIntelligentEquipNvrVO>> findPageNvr(@Validated @RequestBody PatrolIntelligentEquipNvrPageDTO dto)throws GeneralSimpleException {
        log.info("3-1.分页查询硬盘录像机：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findPageNvr(dto));
    }

    @ApiOperation(value = "4.删除摄像机(可批量)")
    @PostMapping(value = "/deleteEquipByList", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Boolean> deleteEquipByList(@Validated @RequestBody List<String> objIds, HttpServletRequest request) throws Exception {
        log.info("4.删除摄像机(可批量)：{}", LogUtil.encode(objIds));
        String remoteIp = BaseCommonUtils.getIP(request);
        return this.response(intelligentEquipService.deleteEquipByList(objIds, remoteIp));
    }

    @ApiOperation(value = "4-1.删除硬盘录像机(可批量)")
    @PostMapping(value = "/deleteNvrByList", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Boolean> deleteNvrByList(@Validated @RequestBody List<String> objIds, HttpServletRequest request) throws Exception {
        log.info("4-1.删除硬盘录像机(可批量)：{}", LogUtil.encode(objIds));
        String remoteIp = BaseCommonUtils.getIP(request);
        return this.response(intelligentEquipService.deleteNvrByList(objIds, remoteIp));
    }
    @ApiOperation(value = "5.导出摄像机台账")
    @PostMapping(value = "/exportEquip")
    public void exportEquip(@Validated @RequestBody PatrolIntelligentEquipQueryDTO dto, HttpServletResponse response) throws Exception {
        log.info("5.导出摄像机台账：{}", LogUtil.encode(dto));
        String filePath = intelligentEquipService.exportEquip(dto);
        String fileName = FilenameUtils.getName(filePath);
        PoiTools.exportExcelFile(filePath, fileName, response);
    }
/*
    @ApiOperation(value = "5-1.导出声纹采集器台账")
    @PostMapping(value = "/exportEquipVoice")
    public void exportEquipVoice(@Validated @RequestBody PatrolIntelligentEquipVoiceQueryDTO dto, HttpServletResponse response) throws Exception {
        log.info("5-1.导出声纹采集器台账：{}", LogUtil.encode(dto));
        String filePath = intelligentEquipService.exportEquipVoice(dto);
        String fileName = FilenameUtils.getName(filePath);
        PoiTools.exportExcelFile(filePath, fileName, response);
    }*/
    @ApiOperation(value = "6.导出硬盘录像机台账")
    @PostMapping(value = "/exportEquipNvr")
    public void exportEquipNvr(@Validated @RequestBody PatrolIntelligentEquipNvrQueryDTO dto, HttpServletResponse response) throws Exception {
        log.info("6.导出硬盘录像机台账：{}", LogUtil.encode(dto));
        String filePath = intelligentEquipService.exportEquipNvr(dto);
        String fileName = FilenameUtils.getName(filePath);
        PoiTools.exportExcelFile(filePath, fileName, response);
    }

    @ApiOperation(value = "7.Nvr关联通道")
    @PostMapping(value = "/relateEquips", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Boolean> relateEquips(@Validated @RequestBody PatrolIntelligentEquipNvrRelateDTO dto) {
        log.info("7.Nvr关联摄像机：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.relateEquips(dto));
    }

    @ApiOperation(value = "8.根据设备类型查询设备树形数据")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "orgId", value = "当前登录用户的orgId", dataType = "string", required = true),
            @ApiImplicitParam(paramType = "header", name = "userId", value = "当前登录用户的userId", dataType = "string", required = true)})
    @PostMapping(value = "/findTree", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipTreeVO>> relateEquips(@RequestBody @Validated PatrolIntelligentEquipTreeDTO dto) throws GeneralSimpleException{
        log.info("8.摄像机树形数据：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findTree(dto));
    }

    @ApiOperation(value = "8-2.查询工程-施工现场树形数据")
    @PostMapping(value = "/findWorkAndWorkSiteTree", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipTreeVO>> findWorkAndWorkSiteTree() throws GeneralSimpleException{
        log.info("8-2.施工现场树形数据：{}", LogUtil.encode(null));
        return this.response(intelligentEquipService.findWorkAndWorkSiteTree());
    }

    @ApiOperation(value = "8-1.声纹树形数据")
    @PostMapping(value = "/findVoiceTree", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<PatrolIntelligentEquipVoiceTreeVO> findVoiceTree(@RequestBody @Validated PatrolIntelligentEquipTreeDTO dto) {
        log.info("8-1.声纹树形数据：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findVoiceTree(dto));
    }

    @ApiOperation(value = "8-3.根据设备类型查询设备树形数据-排除工程部节点")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "orgId", value = "当前登录用户的orgId", dataType = "string", required = true),
            @ApiImplicitParam(paramType = "header", name = "userId", value = "当前登录用户的userId", dataType = "string", required = true)})
    @PostMapping(value = "/findTreeExcludeProjectDepartment", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipTreeVO>> findTreeExcludeProjectDepartment(@RequestBody @Validated PatrolIntelligentEquipTreeDTO dto) throws GeneralSimpleException{
        log.info("8-3.根据设备类型查询设备树形数据-排除工程部节点：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findTreeExcludeProjectDepartment(dto));
    }

     //2024-07-15 查询的有问题，摄像机列表，不应该出现硬盘录像机
    @ApiOperation(value = "9.巡视点位管理-关联摄像机列表")
    @PostMapping(value = "/findByAreaId", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipVO>> findByAreaId(@Validated @RequestBody PatrolIntelligentEquipInspectionDTO dto) {
        log.info("9.巡视点位管理-关联摄像机列表：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findByAreaId(dto));
    }

    @ApiOperation(value = "10.批量数据下发")
    @PostMapping(value = "/callSysList", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Boolean> callSysList(@Validated @RequestBody List<String> objIds) {
        log.info("10.批量数据下发：{}", LogUtil.encode(objIds));
        return this.response(intelligentEquipService.callSysList(objIds));
    }

    @ApiOperation(value = "11.根据主键查询智能设备信息")
    @GetMapping(value = "/findById/{objId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<PatrolIntelligentEquipVO> findById(@PathVariable("objId")String objId) {
        log.info("11.根据主键查询智能设备信息：{}", LogUtil.encode(objId));
        return this.response(intelligentEquipService.findById(objId));
    }

    @ApiOperation(value = "11-1.根据主键查询硬盘录像机信息")
    @GetMapping(value = "/findNvrById/{objId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<PatrolIntelligentEquipNvrVO> findNvrById(@PathVariable("objId")String objId) {
        log.info("11-1.根据主键查询硬盘录像机信息：{}", LogUtil.encode(objId));
        return this.response(intelligentEquipService.findNvrById(objId));
    }

    @ApiOperation(value = "12.根据区域查询摄像机列表")
    @PostMapping(value = "/findIntelligentEquipListByArea", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipListVO>> findIntelligentEquipListByArea(@Validated @RequestBody PatrolIntelligentEquipListDTO equipListDTO) {
        log.info("12.根据区域查询摄像机列表：{}", LogUtil.encode(equipListDTO));
        List<PatrolIntelligentEquipListVO> equipListVOList = intelligentEquipService.findIntelligentEquipListByArea(equipListDTO);
        log.info("12.根据区域查询摄像机列表：success");
        return this.response(equipListVOList);
    }

    @ApiOperation(value = "12-1.根据区域查询声纹列表")
    @PostMapping(value = "/findVoiceListByArea", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipVoiceListVO>> findVoiceListByArea(@Validated @RequestBody PatrolIntelligentEquipListDTO equipListDTO) {
        log.info("12-1.根据区域查询声纹列表：{}", LogUtil.encode(equipListDTO));
        List<PatrolIntelligentEquipVoiceListVO> equipListVOList = intelligentEquipService.findVoiceListByArea(equipListDTO);
        log.info("12-1.根据区域查询声纹列表：success");
        return this.response(equipListVOList);
    }

    @ApiOperation(value = "13.根据Nvr查询关联通道列表")
    @GetMapping(value = "/findByNvrId/{belongEquipId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipChannelNvrVO>> findByNvrId(@PathVariable("belongEquipId")String belongEquipId) {
        log.info("13.根据Nvr查询关联摄像机列表：{}", LogUtil.encode(belongEquipId));
        return this.response(intelligentEquipService.findByNvrId(belongEquipId));
    }

    @ApiOperation(value = "13-1.查询未关联NVR的通道列表")
    @PostMapping(value = "/findNoRelatePage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<IPage<PatrolIntelligentEquipChannelNvrVO>> findNoRelatePage(@RequestBody @Validated PatrolIntelligentEquipChannelNvrDTO dto)throws GeneralSimpleException {
        log.info("13-1.查询未关联NVR的通道列表：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findNoRelatePage(dto));
    }

    @ApiOperation(value = "14.保存轮播方案")
    @PostMapping(value = "/saveOrUpdateCarousel", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Boolean> saveOrUpdateCarousel(@Validated @RequestBody PatrolIntelligentEquipCarouselDTO dto) {
        log.info("14.保存轮播方案：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipCarouselService.saveOrUpdate(dto));
    }

    @ApiOperation(value = "15.查询轮播方案列表")
    @GetMapping(value = "/findListCarousel", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<List<PatrolIntelligentEquipCarouselVO>> findListCarousel()throws GeneralSimpleException {
        log.info("15.查询轮播方案列表：{}", LogUtil.encode(null));
        return this.response(intelligentEquipCarouselService.findList());
    }

    @ApiOperation(value = "16.根据id查询轮播方案详情")
    @GetMapping(value = "/findByIdCarousel/{objId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<PatrolIntelligentEquipCarouselVO> findByIdCarousel(@PathVariable("objId") String objId) {
        log.info("16.根据id查询轮播方案详情：{}", LogUtil.encode(objId));
        return this.response(intelligentEquipCarouselService.findById(objId));
    }

    @ApiOperation(value = "17.根据id删除轮播方案")
    @GetMapping(value = "/deleteById/{objId}")
    public ResponseResult<Boolean> deleteById(@PathVariable("objId") String objId) {
        log.info("17.根据id删除轮播方案：{}", LogUtil.encode(objId));
        return this.response(intelligentEquipCarouselService.deleteById(objId));
    }

//    @ApiOperation(value = "18.录制视频")
//    @PostMapping(value = "/pickVideo")
//    public ResponseResult<Boolean> pickVideo(@RequestBody @Validated PickVideoDTO dto) throws GeneralSimpleException {
//        log.info("18.录制视频：{}", dto);
//        return this.response(intelligentEquipCarouselService.pickVideoCheck(dto));
//    }
//
//
//    @ApiOperation(value = "19.回放视频查询")
//    @PostMapping(value = "/getTodayCanPlaybackTimes")
//    public ResponseResult<List<RecordItem>> getCanPlaybackTimes(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("19.回放视频查询：{}", dto);
//        return this.response(intelligentEquipCarouselService.getCanPlaybackTimes(dto));
//    }
//
//    @ApiOperation(value = "19-1.查询31天回放时间段")
//    @PostMapping(value = "/getCurrentMonthRecordInfo")
//    public ResponseResult<Map> getCurrentMonthRecordInfo(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("19-1.查询31天回放时间段：{}", dto);
//        return this.response(intelligentEquipCarouselService.getCurrentMonthRecordInfo(dto.getProxySipCode(),dto.getChannelCodeNvr()));
//    }
//
//
//    @ApiOperation(value = "20.回放视频的指定时间段播放流路径")
//    @PostMapping(value = "/addStreamProxyBack")
//    public ResponseResult<StreamContent> addStreamProxyBack(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("20.回放视频的指定时间段播放流路径：{}", dto);
//        return this.response(intelligentEquipCarouselService.addStreamProxyBack(dto));
//    }
//
//
//    @ApiOperation(value = "21.回放视频播放进行停止")
//    @PostMapping(value = "/delStreamProxy")
//    public ResponseResult<Boolean> delStreamProxy(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("21.回放视频播放进行停止：{}", dto);
//        return this.response(intelligentEquipCarouselService.delStreamProxy(dto));
//    }
//
//    @ApiOperation(value = "22.回放拖动播放")
//    @PostMapping(value = "/playSeek")
//    public ResponseResult<Boolean> playSeek(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("22.回放拖动播放：{}", dto);
//        return this.response(intelligentEquipCarouselService.playSeek(dto));
//    }
//
//    @ApiOperation(value = "23.回放视频暂停播放")
//    @PostMapping(value = "/playPause")
//    public ResponseResult<Boolean> playPause(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("23.回放视频暂停播放：{}", dto);
//        return this.response(intelligentEquipCarouselService.playPauseOrResume(dto,true));
//    }
//
//    @ApiOperation(value = "24.回放视频恢复播放")
//    @PostMapping(value = "/playResume")
//    public ResponseResult<Boolean> playResume(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("24.回放视频恢复播放：{}", dto);
//        return this.response(intelligentEquipCarouselService.playPauseOrResume(dto,false));
//    }
//
//    @ApiOperation(value = "25.根据点位ID查询摄像机")
//    @PostMapping(value = "/findIntelligentEquipListByPointId", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    public ResponseResult<PatrolIntelligentEquipListVO> findIntelligentEquipListByPointId(@Validated @RequestBody PatrolIntelligentEquipPointDTO dto) {
//        log.info("25.根据点位ID查询摄像机：{}", LogUtil.encode(dto));
//        PatrolIntelligentEquipListVO equipList = intelligentEquipService.findIntelligentEquipListByPointId(dto.getStationId(), dto.getMeasurePointId());
//        log.info("25.根据点位ID查询摄像机：success");
//        return this.response(equipList);
//    }
//
//    @ApiOperation(value = "26.根据通道编码列表更新摄像机离线状态")
//    @PostMapping(value = "/updateStatusByIds", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    public ResponseResult<Boolean> updateStatusByIds(@Validated @RequestBody UpdateStatusDTO dto) {
//        log.info("26.根据通道编码列表更新摄像机离线状态：{}", LogUtil.encode(dto));
//        return this.response(intelligentEquipService.updateStatusByIds(dto));
//    }
//
//    @ApiOperation(value = "27.查看当天可以回放视频的时间区间")
//    @PostMapping(value = "/getCanPlaybackTimes")
//    public ResponseResult<List<RecordItem>> getTodayCanPlaybackTimes(@RequestBody @Validated BackVideoDTO dto) throws GeneralSimpleException {
//        log.info("27.回放视频查询：{}", dto);
//        return this.response(intelligentEquipCarouselService.getTodayCanPlaybackTimes(dto));
//    }
   @ApiOperation(value = "15.根据网络类型查询sip服务连接信息")
   @GetMapping(value = "/findSipInfoByLanType/{lanType}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
   public ResponseResult<SipServerInfoVo> findSipInfoByLanType(@PathVariable("lanType")String lanType) {
       log.info("15.根据网络类型查询sip服务连接信息：{}", LogUtil.encode(lanType));
       return this.response(equipSipService.getSipServerInfo(lanType));
   }

    @ApiOperation(value = "16.根据施工现场id/摄像机id获取所属工程及现场信息")
    @PostMapping(value = "/findWorkAndWorkSiteInfoByWorksiteIdOrEquipObjId", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<ConstructionWorkAndWorkSiteInfoVO> findWorkAndWorkSiteInfoByWorksiteIdOrEquipObjId(@RequestBody ConstructionWorkSiteIdOrEquipObjIdDTO dto) throws GeneralSimpleException {
        log.info("16.根据施工现场id/摄像机id获取所属工程及现场信息：{}", LogUtil.encode(dto));
        return this.response(intelligentEquipService.findWorkAndWorkSiteInfoByWorksiteIdOrEquipObjId(dto));
    }

    @ApiOperation(value = "17.接收设备喊话结果")
    @PostMapping(value = "/sendBroadcastStatus", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseResult<Object> findWorkAndWorkSiteInfoByWorksiteIdOrEquipObjId(@Validated @RequestBody PatrolIntelligentEquipBroadcastStatusDTO dto) throws GeneralSimpleException {
        log.info("17.接收设备喊话结果：{}", LogUtil.encode(dto));
        intelligentEquipService.sendDeviceBroadcastStatus(dto);
        log.info("17.接收设备喊话结果：success");
        return this.response(null);
    }
}
